//
//  Result.swift
//  XHWalletUtils
//
//  Created by xinph on 2020/5/13.
//  Copyright © 2020 xinph. All rights reserved.
//

import Foundation

public enum Result<T> {
    case success(T)
    case failure(XHError)
}

public struct XHError: Error {
    public let errMsg: String?
    public let error: Error?

    public init(_ errMsg: String? = nil, err: Error? = nil) {
        self.errMsg = errMsg
        self.error = err
    }
}


public let mnemonicsLengthError = "助记词长度不正确"
public let mnemonicsError = "助记词不正确"
public let pathError = "推导路径错误"
public let privateKeyError = "私钥不正确"
public let abstractSignerUnknow = "抽象签名未知错误"
public let signerError = "签名失败"
public let generatePrivateKeyFailure = "生成私钥失败"
public let notSuppurt = "非分层钱包，不支持该操作"
public let addressNotFound = "地址不存在"
public let writeFailure = "写入数据库失败"
public let createWalletFailure = "创建钱包失败"
public let createAccountFailure = "创建子账户失败"
public let createSomeAccountFailure = "创建某个地址时操作失败了"
public let getBalanceFailure = "获取余额失败"
